package com.zhiyi.app.service.impl;

import com.zhiyi.app.dao.DevUserMapper;
import com.zhiyi.app.entity.DevUser;
import com.zhiyi.app.service.DevUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author shichenyang
 */
@Service
@Transactional
public class DevUserServiceImpl implements DevUserService {
    @Autowired
    private DevUserMapper userMapper;

    @Override
    public DevUser login(DevUser user) {
        //使用用户名来进行查询
        DevUser u=userMapper.login(user.getDevcode());
        //比较密码是否一致
        if (u!=null){
            //判断是否存在
            if (u.getDevpassword().equals(user.getDevpassword())){
                return u;
            }
        }
        return null;
    }
}
